package com.ruoyi.project.drugs.domain;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;
import java.util.Objects;

public class Drug {
    private Integer drugid;
    private String drugname;
    private Integer drugprice;
    private Integer drugnum;
    private Integer drugtotal;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date drugtime;

    @Override
    public String toString() {
        return "Drug{" +
                "drugid=" + drugid +
                ", drugname='" + drugname + '\'' +
                ", drugprice=" + drugprice +
                ", drugnum=" + drugnum +
                ", drugtotal=" + drugtotal +
                ", drugtime=" + drugtime +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Drug drug = (Drug) o;
        return Objects.equals(drugid, drug.drugid) &&
                Objects.equals(drugname, drug.drugname) &&
                Objects.equals(drugprice, drug.drugprice) &&
                Objects.equals(drugnum, drug.drugnum) &&
                Objects.equals(drugtotal, drug.drugtotal) &&
                Objects.equals(drugtime, drug.drugtime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(drugid, drugname, drugprice, drugnum, drugtotal, drugtime);
    }

    public Integer getDrugid() {
        return drugid;
    }

    public void setDrugid(Integer drugid) {
        this.drugid = drugid;
    }

    public String getDrugname() {
        return drugname;
    }

    public void setDrugname(String drugname) {
        this.drugname = drugname;
    }

    public Integer getDrugprice() {
        return drugprice;
    }

    public void setDrugprice(Integer drugprice) {
        this.drugprice = drugprice;
    }

    public Integer getDrugnum() {
        return drugnum;
    }

    public void setDrugnum(Integer drugnum) {
        this.drugnum = drugnum;
    }

    public Integer getDrugtotal() {
        return drugtotal;
    }

    public void setDrugtotal(Integer drugtotal) {
        this.drugtotal = drugtotal;
    }

    public Date getDrugtime() {
        return drugtime;
    }

    public void setDrugtime(Date drugtime) {
        this.drugtime = drugtime;
    }

    public Drug() {
    }

    public Drug(Integer drugid, String drugname, Integer drugprice, Integer drugnum, Integer drugtotal, Date drugtime) {
        this.drugid = drugid;
        this.drugname = drugname;
        this.drugprice = drugprice;
        this.drugnum = drugnum;
        this.drugtotal = drugtotal;
        this.drugtime = drugtime;
    }
}
